import request from '@/utils/request'

export function listAll(query) {
  return request({
    url: '/student-info/list/',
    method: 'get',
    params: query
  })
}
// 查询所有班级（分页）
export function listAllClass(query) {
  return request({
    url: '/student/classInfo/list',
    method: 'get',
    params: query
  })
}

//新增班级信息
export function saveClass(data) {
  return request({
    url: '/student/classInfo/save',
    method: 'post',
    data: data
  })
}
//给学生分配/修改班级（支持随时变更）
export function updateStudentClass(data) {
  return request({
    url: '/student-info/updateStudentClass',
    method: 'post',
    data: data
  })
}
//查询班级下的学生列表
export function listStudents(id) {
  return request({
    url: '/student-info/listStudents/'+ id,
    method: 'get'
  })
}

export function updateClassInfo(data) {
  return request({
    url: '/student/classInfo',
    method: 'put',
    data: data
  })
}

export function deleteById(id) {
  return request({
    url: '/student/classInfo/' + id,
    method: 'delete'
  })
}

export function updateStudentInfo(data) {
  return request({
    url: '/student-info/update',
    method: 'put',
    data: data
  })
}

export function deleteStudentById(id) {
  return request({
    url: '/student-info/delete/' + id,
    method: 'delete'
  })
}
